package com.itheima.sh.user.client.fallback;

import com.itheima.sh.pojo.Order;
import com.itheima.sh.user.client.OrderClient;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Version: V1.0
 */
@Component
public class OrderClientFallback implements OrderClient {

    // 调用失败的时候会触发
    @Override
    public List<Order> findOrderByUsername(String username) {
        ArrayList<Order> orders = new ArrayList<>();
        Order order = new Order();
        order.setId("-1");
        order.setUsername("通用返回异常");

        orders.add(order);

        return orders;
    }
}
